<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<?php  include 'action/session_check.php'; //登录判断  ?>  
<form action="" method="post">
<table>
<tr>
<td colspan="8">商品信息管理 </td></tr>
<tr>
  <td>编号</td><td>所属类别</td><td>商品名称</td><td>图片</td><td>状态</td>
  <td colspan="3">操作</td>
</tr>
 <?php   
  require_once("../conn/conn_db.php");  //包含数据库连接文件  
  $sql = "select p.*,pt.pt_id,pt.pt_name from product_info p,product_type pt where p.pt_id = pt.pt_id order by p_id desc"; //查询语句
  $result = $conn->query($sql);  //执行SQL语句
  while($row = $result->fetch_array())   //遍历查询结果的每一行
  {
?>
  <tr>
    <td> <?php echo $row["p_id"];?> </td>
    <td> <?php echo $row["pt_name"];?> </td>   
    <td> <?php echo $row["p_name"];?> </td>
    <td> <img src='../<?php echo $row["p_image"];?>' width="39" height="39"/> </td>
    <td> <?php echo $row["p_status"]=='1'? '<font color=blue>已发布</font>':'<font color=red>未发布</font>';?>  </td>
    <td> <a href="action/product_action_do.php?Type=1&p_id=<?php echo $row["p_id"];?>">发布</a></td>
    <td> <a href="action/product_action_do.php?Type=2&p_id=<?php echo $row["p_id"];?>">放入回收站</a></td>
	<td> <a href="action/product_action_do.php?Type=3&p_id=<?php echo $row["p_id"];?>">删除</a></td>
    <td> <a href="product_update.php?p_id=<?php echo $row["p_id"];?>">编辑</a></td>
  </tr>
<?php }   ?>
 </table>
</form>
</body>
</html>